#ifndef _PIANO_PROGRAM_NOTE_RENDERER_H_
#define _PIANO_PROGRAM_NOTE_RENDERER_H_

#include <ne.h>
#include <NoteTrackRenderer.h>

namespace pp
{
    const ne::Color NoteTrackColor[12] =
    {
        ne::Color(1.0f, 0.0f, 0.0f, 1.0f),
        ne::Color(1.0f, 0.0f, 0.5f, 1.0f),
        ne::Color(1.0f, 1.0f, 0.0f, 1.0f),
        ne::Color(1.0f, 1.0f, 0.5f, 1.0f),
        ne::Color(1.0f, 0.5f, 0.75f, 1.0f),

        ne::Color(0.0f, 1.0f, 0.0f, 1.0f),
        ne::Color(0.75f, 1.0f, 0.0f, 1.0f),

        ne::Color(0.0f, 0.5f, 1.0f, 1.0f),
        ne::Color(0.5f, 0.5f, 1.0f, 1.0f),
        ne::Color(0.75f, 0.5f, 1.0f, 1.0f),
        ne::Color(0.5f, 0.75f, 1.0f, 1.0f),
        ne::Color(0.75f, 0.75f, 1.0f, 1.0f),
    };

    class NoteRenderer
    {
        public:
            NoteRenderer();

            bool build(const ne::MIDISequencePtr pSequnce);

            bool update(const double startTicks, const double endTicks, const double deltaY);

            bool render();

            void destroy();

            ~NoteRenderer();

        private:
            NoteTrackRendererList mNoteTrackRendererList;
    };
}

#endif
